CC =      arm-apple-darwin-gcc \
		  -I/usr/local/arm-apple-darwin/include
LD = $(CC)
LDFLAGS =  -framework Message \
          -framework CoreFoundation \
          -framework Foundation \
          -framework UIKit \
          -framework IOKit \
          -framework LayerKit \
          -framework CoreGraphics \
          -framework CoreTelephony \
          -framework GraphicsServices \
          -framework CoreSurface \
          -framework Celestial \
          -framework CoreAudio \
          -framework Message \
	  -framework WebCore \
          -framework WebKit \
      	  -lobjc \
      	  -lz 

#CFLAGS = -DDEBUG

all:	iBlip package

%.o:	%.m
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o:	%.c
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o:	%.cpp
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
	
iBlip:	main.o iBlipApp.o ViewController.o
	$(LD) $(LDFLAGS) -o $@ $^

clean:
	rm -f *.o iBlip
	rm -rf iBlip.app

package:
	mkdir -p iBlip.app
	cp iBlip ./iBlip.app/
	cp resources/*.plist ./iBlip.app/
